//This is a cmocean colormap
//All credit to Kristen Thyng
//This colormap is under the MIT License
//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb

namespace ScottPlot.Colormaps;

public class Thermal : IColormap
{
    public string Name => "Thermal";
    readonly CustomPalette Colormap;
    public Color GetColor(double position) => Colormap.GetColor(position);
    public Thermal()
    {
        Color[] colors =
        [
            new( 4, 35, 51 ),
            new( 4, 36, 53 ),
            new( 4, 37, 55 ),
            new( 4, 37, 57 ),
            new( 5, 38, 59 ),
            new( 5, 39, 61 ),
            new( 5, 39, 63 ),
            new( 5, 40, 65 ),
            new( 5, 41, 67 ),
            new( 6, 41, 69 ),
            new( 6, 42, 71 ),
            new( 6, 43, 73 ),
            new( 7, 43, 75 ),
            new( 7, 44, 77 ),
            new( 7, 44, 80 ),
            new( 8, 45, 82 ),
            new( 8, 46, 84 ),
            new( 9, 46, 86 ),
            new( 9, 47, 89 ),
            new( 10, 47, 91 ),
            new( 11, 48, 93 ),
            new( 12, 48, 96 ),
            new( 12, 48, 98 ),
            new( 13, 49, 101 ),
            new( 14, 49, 103 ),
            new( 15, 50, 106 ),
            new( 16, 50, 108 ),
            new( 18, 50, 111 ),
            new( 19, 51, 114 ),
            new( 20, 51, 116 ),
            new( 22, 51, 119 ),
            new( 23, 51, 122 ),
            new( 25, 51, 124 ),
            new( 26, 52, 127 ),
            new( 28, 52, 130 ),
            new( 30, 52, 132 ),
            new( 31, 52, 135 ),
            new( 33, 52, 138 ),
            new( 35, 52, 140 ),
            new( 37, 52, 143 ),
            new( 39, 52, 145 ),
            new( 42, 51, 147 ),
            new( 44, 51, 149 ),
            new( 46, 51, 151 ),
            new( 48, 51, 153 ),
            new( 51, 51, 155 ),
            new( 53, 51, 156 ),
            new( 55, 51, 157 ),
            new( 57, 51, 158 ),
            new( 60, 51, 159 ),
            new( 62, 52, 159 ),
            new( 64, 52, 159 ),
            new( 66, 52, 160 ),
            new( 68, 53, 160 ),
            new( 70, 53, 160 ),
            new( 71, 54, 160 ),
            new( 73, 54, 159 ),
            new( 75, 55, 159 ),
            new( 77, 55, 159 ),
            new( 78, 56, 158 ),
            new( 80, 57, 158 ),
            new( 82, 57, 157 ),
            new( 83, 58, 157 ),
            new( 85, 59, 157 ),
            new( 86, 59, 156 ),
            new( 88, 60, 156 ),
            new( 89, 61, 155 ),
            new( 91, 61, 155 ),
            new( 92, 62, 154 ),
            new( 94, 63, 154 ),
            new( 95, 63, 153 ),
            new( 96, 64, 153 ),
            new( 98, 65, 152 ),
            new( 99, 65, 152 ),
            new( 101, 66, 151 ),
            new( 102, 67, 151 ),
            new( 103, 67, 150 ),
            new( 105, 68, 150 ),
            new( 106, 69, 149 ),
            new( 108, 69, 149 ),
            new( 109, 70, 148 ),
            new( 110, 71, 148 ),
            new( 112, 71, 148 ),
            new( 113, 72, 147 ),
            new( 114, 72, 147 ),
            new( 116, 73, 146 ),
            new( 117, 74, 146 ),
            new( 118, 74, 146 ),
            new( 120, 75, 145 ),
            new( 121, 75, 145 ),
            new( 122, 76, 145 ),
            new( 124, 77, 144 ),
            new( 125, 77, 144 ),
            new( 126, 78, 144 ),
            new( 128, 78, 143 ),
            new( 129, 79, 143 ),
            new( 131, 80, 143 ),
            new( 132, 80, 142 ),
            new( 133, 81, 142 ),
            new( 135, 81, 142 ),
            new( 136, 82, 141 ),
            new( 137, 82, 141 ),
            new( 139, 83, 141 ),
            new( 140, 83, 140 ),
            new( 142, 84, 140 ),
            new( 143, 84, 140 ),
            new( 144, 85, 139 ),
            new( 146, 85, 139 ),
            new( 147, 86, 139 ),
            new( 149, 86, 138 ),
            new( 150, 87, 138 ),
            new( 151, 87, 138 ),
            new( 153, 88, 137 ),
            new( 154, 88, 137 ),
            new( 156, 89, 137 ),
            new( 157, 89, 136 ),
            new( 159, 90, 136 ),
            new( 160, 90, 135 ),
            new( 162, 91, 135 ),
            new( 163, 91, 134 ),
            new( 165, 92, 134 ),
            new( 166, 92, 134 ),
            new( 168, 93, 133 ),
            new( 169, 93, 132 ),
            new( 171, 93, 132 ),
            new( 172, 94, 131 ),
            new( 174, 94, 131 ),
            new( 175, 95, 130 ),
            new( 177, 95, 130 ),
            new( 178, 96, 129 ),
            new( 180, 96, 128 ),
            new( 181, 97, 128 ),
            new( 183, 97, 127 ),
            new( 184, 98, 126 ),
            new( 186, 98, 126 ),
            new( 187, 98, 125 ),
            new( 189, 99, 124 ),
            new( 190, 99, 123 ),
            new( 192, 100, 123 ),
            new( 193, 100, 122 ),
            new( 195, 101, 121 ),
            new( 196, 101, 120 ),
            new( 198, 102, 119 ),
            new( 199, 102, 118 ),
            new( 201, 103, 117 ),
            new( 202, 103, 116 ),
            new( 204, 104, 115 ),
            new( 205, 104, 114 ),
            new( 206, 105, 113 ),
            new( 208, 105, 112 ),
            new( 209, 106, 111 ),
            new( 211, 106, 110 ),
            new( 212, 107, 109 ),
            new( 214, 108, 108 ),
            new( 215, 108, 107 ),
            new( 216, 109, 106 ),
            new( 218, 110, 105 ),
            new( 219, 110, 104 ),
            new( 220, 111, 102 ),
            new( 222, 112, 101 ),
            new( 223, 112, 100 ),
            new( 224, 113, 99 ),
            new( 225, 114, 98 ),
            new( 227, 114, 96 ),
            new( 228, 115, 95 ),
            new( 229, 116, 94 ),
            new( 230, 117, 93 ),
            new( 231, 118, 91 ),
            new( 232, 119, 90 ),
            new( 234, 120, 89 ),
            new( 235, 121, 88 ),
            new( 236, 121, 86 ),
            new( 237, 122, 85 ),
            new( 238, 123, 84 ),
            new( 238, 125, 83 ),
            new( 239, 126, 82 ),
            new( 240, 127, 80 ),
            new( 241, 128, 79 ),
            new( 242, 129, 78 ),
            new( 243, 130, 77 ),
            new( 243, 131, 76 ),
            new( 244, 133, 75 ),
            new( 245, 134, 74 ),
            new( 245, 135, 73 ),
            new( 246, 136, 72 ),
            new( 246, 138, 71 ),
            new( 247, 139, 70 ),
            new( 247, 140, 69 ),
            new( 248, 142, 68 ),
            new( 248, 143, 67 ),
            new( 249, 145, 67 ),
            new( 249, 146, 66 ),
            new( 249, 147, 65 ),
            new( 250, 149, 65 ),
            new( 250, 150, 64 ),
            new( 250, 152, 63 ),
            new( 251, 153, 63 ),
            new( 251, 155, 62 ),
            new( 251, 156, 62 ),
            new( 251, 158, 62 ),
            new( 251, 159, 61 ),
            new( 251, 161, 61 ),
            new( 252, 163, 61 ),
            new( 252, 164, 61 ),
            new( 252, 166, 60 ),
            new( 252, 167, 60 ),
            new( 252, 169, 60 ),
            new( 252, 170, 60 ),
            new( 252, 172, 60 ),
            new( 252, 174, 60 ),
            new( 252, 175, 60 ),
            new( 252, 177, 60 ),
            new( 251, 178, 61 ),
            new( 251, 180, 61 ),
            new( 251, 182, 61 ),
            new( 251, 183, 61 ),
            new( 251, 185, 62 ),
            new( 251, 187, 62 ),
            new( 251, 188, 62 ),
            new( 250, 190, 63 ),
            new( 250, 191, 63 ),
            new( 250, 193, 64 ),
            new( 250, 195, 64 ),
            new( 249, 196, 65 ),
            new( 249, 198, 65 ),
            new( 249, 200, 66 ),
            new( 248, 201, 67 ),
            new( 248, 203, 67 ),
            new( 248, 205, 68 ),
            new( 247, 206, 69 ),
            new( 247, 208, 69 ),
            new( 247, 210, 70 ),
            new( 246, 211, 71 ),
            new( 246, 213, 71 ),
            new( 245, 215, 72 ),
            new( 245, 216, 73 ),
            new( 244, 218, 74 ),
            new( 244, 220, 75 ),
            new( 243, 221, 75 ),
            new( 243, 223, 76 ),
            new( 242, 225, 77 ),
            new( 242, 226, 78 ),
            new( 241, 228, 79 ),
            new( 241, 230, 80 ),
            new( 240, 232, 81 ),
            new( 239, 233, 81 ),
            new( 239, 235, 82 ),
            new( 238, 237, 83 ),
            new( 237, 238, 84 ),
            new( 237, 240, 85 ),
            new( 236, 242, 86 ),
            new( 235, 244, 87 ),
            new( 234, 245, 88 ),
            new( 234, 247, 89 ),
            new( 233, 249, 90 ),
            new( 232, 250, 91 ),
        ];

        Colormap = new CustomPalette(colors);
    }
}

